package com.deke.order.controller;

import com.deke.order.service.VideoService;
import com.deke.vo.Result;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @version 1.0
 * @Author :LiM
 * @Date :2022/12/28 13:26
 */
@RestController
@RequestMapping("/order/video")
public class VideoController {
    /**
     * 服务对象
     */
    @Resource
    private VideoService videoService;

    /**
     * 根据课程id获取所有的章节的视频
     * @param courseId
     * @return
     */
    @PostMapping("queryAllVideoByCourseId/{id}")
    public Result queryVideoByCourseId(@PathVariable(name = "id") String courseId){
        return videoService.queryVideoByCourseId(courseId);
    }
}
